<?php

namespace Database\Factories;

use App\Models\User;
use App\Models\UserBill;
use Illuminate\Database\Eloquent\Factories\Factory;

class UserBillFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = UserBill::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'user_id' => $this->faker->randomElement(User::pluck('id')),
            'link_id' => 1,
            'pm' => $this->faker->numberBetween(0, 1),
            'title' => $this->faker->text(10),
            'category' => 'I Don`t No',
            'type' => $this->faker->randomElement(['promotionOrderCommission', 'promotionUserCommission', 'commissionWithdrawal',
                'winningBalance', 'offlineCashier', 'buyMember', 'purchaseGoods', 'balancePayment', 'merchandiseRefund', 'balanceRecharge', 'shareRecords', 'increaseBalance', 'systemRefund']),
            'number' => $this->faker->randomFloat(2, 1, 50000),
            'balance' => $this->faker->randomFloat(2, 1, 50000),
            'mark' => $this->faker->text(30),
            'status' => $this->faker->randomElement(['effective', 'invalid', 'determine']),
            'take' => $this->faker->numberBetween(0, 1),
        ];
    }
}
